package com.zxkj.domain.entity;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import java.io.Serializable;

@Embeddable
public class SciMapAdCorporationPK implements Serializable {
    public SciMapAdCorporationPK() {
    }

    public SciMapAdCorporationPK(String adId, Integer corpId) {
        this.adId = adId;
        this.corpId = corpId;
    }

    private static final long serialVersionUID = -2432145316543676L;
    @Column(nullable = false)
    private String adId;
    @Column(nullable = false)
    private Integer corpId;

    public String getAdId() {
        return adId;
    }

    public void setAdId(String adId) {
        this.adId = adId;
    }

    public Integer getCorpId() {
        return corpId;
    }

    public void setCorpId(Integer corpId) {
        this.corpId = corpId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SciMapAdCorporationPK that = (SciMapAdCorporationPK) o;

        if (adId != null ? !adId.equals(that.adId) : that.adId != null) return false;
        return corpId != null ? corpId.equals(that.corpId) : that.corpId == null;
    }

    @Override
    public int hashCode() {
        int result = adId != null ? adId.hashCode() : 0;
        result = 31 * result + (corpId != null ? corpId.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "SciMapAdCorporationPK{" +
                "adId='" + adId + '\'' +
                ", corpId=" + corpId +
                '}';
    }
}
